<template>
    <div class="appCon">
        <el-form label-width="120px" class="app-content" :rules="rules" :model="ruleForm" ref="ruleForm">
            <div class="dataItem" v-for='(site,index) in ruleForm.subdataNumber' :key="index">
                <button v-if = "index == ruleForm.subdataNumber.length-1 && index" @click = "removeItem(index,site)" type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="考试科目：" :prop="'subdataNumber.' + index + '.examSub'" :rules="checkexamSub(index)">
                            <el-select v-model="site.examSub" style="width:95%;" placeholder="请选择考试科目">
                                <el-option v-for="item in ruleForm.examList" :key="item.fSubjectId" :label="item.sSubjectName" :value="item.fSubjectId">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7">
                        <el-form-item label="考试日期：" :prop="'subdataNumber.' + index + '.getDate'" 
                        :rules="getExamDate(index)">
                            <el-date-picker
                            v-model="site.getDate"
                            :editable="false" 
                            :clearable="false"
                            type="date"
                            placeholder="选择日期"
                            @change = "getExaming(site, index)"
                            style="width:95%;"
                            :picker-options="ruleForm.pickerOptions">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7">
                        <el-form-item label="考试时间：" :prop="'subdataNumber.' + index + '.getTime'" :rules="vertifyTime(index)">
                            <el-time-picker
                                is-range
                                :editable="false" 
                                :clearable="false"
                                v-model="site.getTime"
                                format="HH:mm"
                                style="width:95%;"
                                @change = "getExaming(site, index)"
                                placeholder="选择时间范围">
                            </el-time-picker>
                        </el-form-item>
                    </el-col>
                    <!--                     
                        提示:
                        1：逻辑修改：同一个考场允许重叠时段进行2场考试，即每个考场最多有两段重叠时间的考试，
                           但这两场考试的开始时间必须相同；
                        2：验证是否有同一考场包含重叠时段的考试，且考试开始时间一致，如果开始时间不一致，
                           提示：【考场名称】的两场考试时间有重叠，开始时间必须一致；
                     -->
                </el-row> 
                <el-row>
                    <el-col :span='20' class='isUpdataPb'>
                        <el-form-item label="选择考场：" :prop="'subdataNumber.' + index + '.ExamNoIds'" :rules="{ type:'array', required: true, message: '选择考场不能为空', trigger: 'blur'}">
                            <div v-if = "index === 0 || site.roomPanelHide">
                                <el-checkbox v-model="site.checkAll" @change="handleCheckAllChange(site.checkAll,index)">全选</el-checkbox>
                                <div style="margin: 15px 0;"></div>
                                <el-checkbox-group class = 'el-checkbox-group' v-model="site.ExamNoIds" 
                                @change="handleCheckedExamNoIdsChange(site.ExamNoIds,index,site)">
                                    <el-checkbox v-for="examRoom in site.examRooms" :label="examRoom" :key="examRoom">
                                        {{examRoom.sRoomnum}}
                                    </el-checkbox>
                                </el-checkbox-group>
                            </div>
                        </el-form-item>
                    </el-col>
                </el-row>
                <!-- 监考老师：产品又不要了，这里先注释掉，要的话再加上 -->
                <!-- <el-row>
                    <el-col :span='8' class='isUpdataPb'>
                        <el-form-item label="监考老师：" :prop="'subdataNumber.' + index + '.sMasterTeacher'" 
                            :rules="[{ pattern: /^[^\s]+$/, message: '请勿输入空格', trigger: 'blur' },{ min: 0, max: 30, message: '最大输入30个字符', trigger: 'change' }]">
                           <el-input v-model="site.sMasterTeacher" placeholder="请输入监考老师姓名"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row> -->
            </div>
            <el-button type="text" @click="addNumber" class="addBtn"><i class="el-icon-plus"></i>继续添加</el-button>
        </el-form>
    </div>
</template>
<script>
import { listsubject, selectExamsubject } from 'api/wisdom';
import { mapGetters } from 'vuex';
import moment from 'moment';
export default {
    name: 'createSub',

    props: {
        ExamInfo: {
            return: {
                type: Object,
                default: []
            }
        }
    },
    data() {
        return {
            PidsArr:[],
            ruleForm: {
                subdataNumber: [], // 所有科目list 页面form表单遍历的数据
                examList: [],
                pickerOptions: {
                    disabledDate(time) {
                    }
                }
            },
            createIndex: 0,
            examDTOList: [],
            AllRoomsInfo: [],
            listSubjectDTO: [],//回填的数据
            rules: {}
        };
    },
    computed: {
        ...mapGetters(['schoolId', 'schoolName'])
        
    },
    mounted() {
        this.getlistsubject().then(() => {// 获取下拉考试科目
            this.isUpdatesub();// 判断 是回填还是编辑
        })
        
    },
    methods: {
    // 全选
        handleCheckAllChange(isCheckAll, index) {
            if (isCheckAll) {
                this.ruleForm.subdataNumber[index].ExamNoIds = this.ruleForm.subdataNumber[index].examRooms;
            } else {
                this.ruleForm.subdataNumber[index].ExamNoIds = [];
            }
            this.handleCheckedExamNoIdsChange(this.ruleForm.subdataNumber[index].ExamNoIds, index, this.ruleForm.subdataNumber[index]);
        },
    // 选择考场时
        handleCheckedExamNoIdsChange(noIdList, index, site, state) {
            this.getExamingRooms(site, index);// 操作项的整个item信息  索引
        },
    // 根据时间获取考场
        getExaming(item, index) {
            if (item.getDate) {
                if (item.getTime && Date.parse(item.getTime[0])) {
                    this.ruleForm.subdataNumber[index].examDate = [];
                    this.ruleForm.subdataNumber[index].examDate[0] = Date.parse(item.getDate) + ((item.getTime[0]).getHours() * 60 + (item.getTime[0]).getMinutes()) * 60 * 1000;
                    this.ruleForm.subdataNumber[index].examDate[1] = Date.parse(item.getDate) + ((item.getTime[1]).getHours() * 60 + (item.getTime[1]).getMinutes()) * 60 * 1000;
                    this.ruleForm.subdataNumber[index].startTime = this.ruleForm.subdataNumber[index].examDate[0];
                    this.ruleForm.subdataNumber[index].endTime = this.ruleForm.subdataNumber[index].examDate[1];
                }
            } 
            this.getExamingRooms(item, index);
        },
        

        // 选择考场 或者 时间时触发的方法  每个科目进行筛选出 可选的考场
        getExamingRooms(item, index) {// 操作项 操作项的索引
            if (item && item.examDate && item.examDate[0]) {
                for (let index = 0;index < this.ruleForm.subdataNumber.length;index++) {// 遍历每一个考试科目
                    let room = this.ruleForm.subdataNumber[index];// 每个科目
                    let curCanArr = this.getCanSelectArr(room);// 每个科目进行筛选出 可选考场
                    room.examRooms = curCanArr;// 页面遍历出 可选的考场
                    if (item && item.ExamNoIds.length) {
                        room.ExamNoIds = room.ExamNoIds.filter(function(v) {
                            return curCanArr.indexOf(v) > -1;
                        });
                    }
                    if (room.examRooms.length == room.ExamNoIds.length) {
                        room.checkAll = true;
                    } else {
                        room.checkAll = false;
                    }
                }
                if (this.ruleForm.subdataNumber[index]) {

                    this.ruleForm.subdataNumber[index].roomPanelHide = true;
                }
            } else {
                if (item) {
                    item.examDate = null;
                }
            }
        },
        // 可选考场
        getCanSelectArr(item) {// item 操作项
            let hasInKC2 = this.getConflictRoom(item);
            let canArr = this.AllRoomsInfo.filter(function(item) {// 去掉已选的 就是可选的
                return hasInKC2.indexOf(item) == -1;
            });
            return canArr;
        },
     

        // 与当前教室时间冲突的所有教室
        getConflictRoom(item) {// 操作项
            let hasInKC2=[];// 同一个开始时间 选过两次的考场 被送进冲突数组 还有 只是相交的选过的考场
            if (item && item.examDate) {
                let startTime = item.examDate[0];// 当前项的开始时间和结束时间
                let endTime = item.examDate[1];
                let subdataNumber = this.ruleForm.subdataNumber;
                let sameStartTimeArr=[];// 除了自己 所有开始时间相同的项目
                for (let index = 0; index < subdataNumber.length; index++) {
                    if (item.pId != subdataNumber[index].pId) {// 遍历不是当前项的
                        let one =subdataNumber[index].startTime <= startTime &&startTime < subdataNumber[index].endTime;
                        let two =endTime > subdataNumber[index].startTime &&endTime <= subdataNumber[index].endTime;
                        let three = subdataNumber[index].startTime >= startTime &&endTime >= subdataNumber[index].endTime;
                        let situation1=startTime!==subdataNumber[index].startTime;// 开始时间不相等
                        let situation2=startTime==subdataNumber[index].startTime;// 开始时间相等
                        let jiaoJi= one || two || three;// 有交集
                        this.AllRoomsInfo.forEach((current) => {
                            current.chosedNumber = 0;
                        })
                        if (situation1&&jiaoJi) {// 只是相交
                            if (subdataNumber[index].ExamNoIds.length) {
                                subdataNumber[index].ExamNoIds.forEach((element) => {
                                    hasInKC2.push(element)
                                })
                            }
                        }
                      
                        if (situation2) {
                            sameStartTimeArr.push(subdataNumber[index])
                            sameStartTimeArr.forEach((item) => {
                                this.AllRoomsInfo.forEach(currentExam => {// 所有考场
                                    item.ExamNoIds.forEach((everyChosed) => {
                                        if (currentExam.pId==everyChosed.pId) {
                                            currentExam.chosedNumber++;
                                        }
                                    })
                                })
                            })
                            this.AllRoomsInfo.forEach((current) => {
                                if (current.chosedNumber ==2) {
                                    hasInKC2.push(current)
                                }
                            })
                        }
                    }
                }
            }
            return hasInKC2
        },

        

        // 遍历判断重复
        getTimeAndDataSame(index) {

            if (this.ruleForm.subdataNumber[index].getDate && this.ruleForm.subdataNumber[index].getTime && this.ruleForm.subdataNumber[index].examSub) {
                let list = [...this.ruleForm.subdataNumber];
                list.splice(index, 1);
                return list.some(item => {
                    let a = moment(this.ruleForm.subdataNumber[index].getDate).format('YYYY-MM-DD') == moment(item.getDate).format('YYYY-MM-DD');
                    let b = Date.parse(moment(this.ruleForm.subdataNumber[index].getTime[0]).format('YYYY-MM-DD HH:mm')) == Date.parse(moment(item.getTime[0]).format('YYYY-MM-DD HH:mm'));
                    let c = Date.parse(moment(this.ruleForm.subdataNumber[index].getTime[1]).format('YYYY-MM-DD HH:mm')) == Date.parse(moment(item.getTime[1]).format('YYYY-MM-DD HH:mm'));
                    let d = this.ruleForm.subdataNumber[index].examSub == item.examSub;
                    return a && b && c && d;
                });
            }
        },

        // 获取科目
        getlistsubject() {
            return listsubject(this.schoolId).then(res => {
                this.ruleForm.examList = res.data.content;
            });
        },

        // 是否更新状态（编辑
        isUpdatesub() {
           
            this.updateWisdomSubject().then(() => {// 里面判断是回填 还是 新增
                this.checklistSubjectDTO();// 回填
            });
        },

    // 更新科目 修改
        updateWisdomSubject() {
            let listExamroom = [];
            this.ExamInfo.forEach(item => {
                listExamroom.push({
                    pId: item.fExamId,
                    sRoomnum: item.examNoText,
                    fClassId: item.pId
                });
            });
            return selectExamsubject(this.$route.params.id, listExamroom).then(response => {// 回填的接口
                this.$emit('lodingHideShow', false)
                if (response.data.content.examDTO) {
                    this.examDTOList[0] = Date.parse(response.data.content.examDTO.sStartDate);
                    this.examDTOList[1] = Date.parse(response.data.content.examDTO.sEndDate);
                    let that = this;
                    this.ruleForm.pickerOptions={
                        disabledDate(time) {
                            return time.getTime() < Date.now() - 864e5 || (time.getTime() < that.examDTOList[0]-86400 || time.getTime() > that.examDTOList[1]);
                        }
                    }
                }
                if (response.data.content.roomlist) {
                    this.AllRoomsInfo = response.data.content.roomlist;
                    if (response.data.content.subjectDTO.length) {// subjectDTO->回填的内容
                        this.listSubjectDTO = response.data.content.subjectDTO;// 回填的内容
                        console.log('回填的',this.listSubjectDTO)
                    } else {// 新增 一个
                        this.ruleForm.subdataNumber = [//页面 考试科目的list
                            {

                                pId: this.createIndex,
                                examSub: '', // 选中科目
                                examDate: null, // 日期
                                getDate: '',
                                getTime: '',
                                startTime: null,
                                endTime: null,
                                roomPanelHide: false, // 显示隐藏
                                isIndeterminate: false, // 半选
                                checkAll: false, // 全选
                                sMasterTeacher: '', // 监考老师名字
                                examRooms: this.AllRoomsInfo, // 所有考场
                                ExamNoIds: [] // 选中考场
                            }
                        ];
                    }
                }
            }).catch(() => {
                this.$emit('lodingHideShow', false)
            });
        },

    // 科目列表渲染
        checklistSubjectDTO() {
            if (this.listSubjectDTO.length) {
                let index = -1;
                this.listSubjectDTO.forEach(item => {
                    index++;
                    let sStarttime1 = item.sStarttime.substring(0, 4);
                    let sStarttime2 = item.sStarttime.substring(5, 7) - 1;
                    let sStarttime3 = item.sStarttime.substring(8, 10);
                    let sStarttime4 = item.sStarttime.substring(11, 13);
                    let sStarttime5 = item.sStarttime.substring(14, 16);
                    let sEndtime1 = item.sEndtime.substring(0, 4);
                    let sEndtime2 = item.sEndtime.substring(5, 7) - 1;
                    let sEndtime3 = item.sEndtime.substring(8, 10);
                    let sEndtime4 = item.sEndtime.substring(11, 13);
                    let sEndtime5 = item.sEndtime.substring(14, 16);
                    let obj = {
                        pId: item.pId,//该考试科目项的id
                        sMasterTeacher: item.sMasterTeacher,////该考试科目项的监考老师
                        examSub: this.getSubjectid(item.fSubjectid),//学科
                        examDate: null, 
                        getDate: new Date(sStarttime1, sStarttime2, sStarttime3, 0, 0), // 日期
                        getTime: [
                            new Date(sStarttime1,sStarttime2,sStarttime3,sStarttime4,sStarttime5),
                            new Date(sEndtime1,sEndtime2,sEndtime3,sEndtime4,sEndtime5)
                        ], 
                        roomPanelHide: true, // 显示隐藏
                        isIndeterminate: false, // 半选
                        checkAll: false, // 全选
                        examRooms: this.AllRoomsInfo, // 所有考场
                        ExamNoIds: this.checkexamIds(item) // 选中考场
                    };
                    this.ruleForm.subdataNumber.push(obj);//把回填的内容 push进去到 页面展示数据里面
                    console.log(this.ruleForm.subdataNumber,'-----9999999')
                    this.getExaming(obj, index);
                });
            }
        },

        // 返回所选考场
        checkexamIds(item) {
            let examids = [];
            for (let i = 0; i < this.AllRoomsInfo.length; i++) {
                for (let j = 0; j < item.sRoomnum.length; j++) {
                    if (item.sRoomnum[j] == this.AllRoomsInfo[i].pId) {
                        examids.push(this.AllRoomsInfo[i]);
                    }
                }
            }
            return examids;
        },

        // 获取科目id
        getSubjectid(fSubjectid) {
            let selectedArr = '';
            for (let i = 0; i < this.ruleForm.examList.length; i++) {
                if (this.ruleForm.examList[i].fSubjectId == fSubjectid) {
                    selectedArr = fSubjectid;
                    break;
                }
            }
            return selectedArr;
        },
        // 添加
        addNumber() {
            let examobj = {// 每一项科目的信息
                pId: ++this.createIndex,
                examSub: '',
                examDate: null,
                getDate: '',
                getTime: '',
                startTime: null,
                endTime: null,
                roomPanelHide: false, // 考场面板显示隐藏
                sMasterTeacher: '', // 监考老师姓名
                isIndeterminate: false,
                checkAll: false, // 全选
                examRooms: [], // 可选所有考场
                ExamNoIds: [] // 当前选中考场
            };
            this.ruleForm.subdataNumber.push(examobj);
        },
        // 删除
        removeItem(index, item) {
            this.$confirm('确定要删除考试科目?', ' ', {
                confirmButtonText: '确定',
                cancelButtonText: '取消'
            }).then(() => {
                this.ruleForm.subdataNumber.splice(index, 1);
                this.getExamingRooms(item, index);
            });
        },
         // 提交
        submitForm() {
            this.$refs['ruleForm'].validate(valid => {
                if (valid) {
                    this.$emit('submitData', this.ruleForm.subdataNumber, this.listSubjectDTO);
                }
            });
        },
        // 验证时间
        vertifyTime(index) {
            return [
                {
                    type: 'array',
                    required: true,
                    message: '请选择考试时间',
                    trigger: 'blur'
                },
                {
                    validator: (rule, value, callback) => {
                        if (value && value[0]) {
                            if (value[0] >= value[1]) {
                                callback(new Error('结束时间必须大于开始时间'));
                            }
                            if (this.getTimeAndDataSame(index)) {
                                callback(new Error('所选科目和时间完全重复'));
                            } else {
                                callback();
                            }
                            
                        } else {
                            callback(new Error('请选择考试时间'));
                        }
                    },
                    trigger: 'change, blur'
                }
            ];
        },
        // 验证
        getExamDate(index) {
            return [
                {
                    required: true,
                    validator: (rule, value, callback) => {
                        if (value) {
                            if (this.getTimeAndDataSame(index)) {
                                callback(new Error('所选科目和时间完全重复'));
                            } else {
                                callback();
                            }
                            
                        } else {
                            callback(new Error('请选择考试日期'));
                        }
                    },
                    trigger: 'change, blur'
                }
            ];
        },
    // 验证选择框
        checkexamSub(index) {
            return [
                {
                    required: true,
                    validator: (rule, value, callback) => {
                        if (this.getTimeAndDataSame(index)) {
                            callback(new Error('所选科目和时间完全重复'));
                        } else if (value == '') {
                            callback(new Error('请选择考试科目'));
                        } else {
                            callback();
                        }
                    },
                    trigger: 'change, blur'
                }
            ];
        },
// 全选
        // handleCheckAllChange(isCheckAll, index) {
        //     if (isCheckAll) {
        //         this.ruleForm.subdataNumber[index].ExamNoIds = this.ruleForm.subdataNumber[index].examRooms;
        //     } else {
        //         this.ruleForm.subdataNumber[index].ExamNoIds = [];
        //     }
        //     this.handleCheckedExamNoIdsChange(
        //         this.ruleForm.subdataNumber[index].ExamNoIds,
        //         index,
        //         this.ruleForm.subdataNumber[index]
        //     );
        // },

        // 选择考场
        // handleCheckedExamNoIdsChange(noIdList, index, site, state) {
        //     this.getExamingRooms(site, index);
        // },

        // 与当前教室时间冲突的所有教室
        // getConflictRoom(item) {
        //     let conflictRoomArr = [];
        //     if (item && item.examDate) {
        //         let startTime = item.examDate[0];
        //         let endTime = item.examDate[1];
        //         let subdataNumber = this.ruleForm.subdataNumber;
        //         // 冲突的room
        //         for (let index = 0; index < subdataNumber.length; index++) {
        //             if (item.pId != subdataNumber[index].pId) {
        //                 let one =
        //       subdataNumber[index].startTime <= startTime &&
        //       startTime < subdataNumber[index].endTime;
        //                 let two =
        //       endTime > subdataNumber[index].startTime &&
        //       endTime <= subdataNumber[index].endTime;
        //                 let three =
        //       subdataNumber[index].startTime >= startTime &&
        //       endTime >= subdataNumber[index].endTime;
        //                 // //console.log('>>>>>>>>>>>666', item.examDate);
        //                 if (one || two || three) {
        //                     conflictRoomArr.push(subdataNumber[index]);
        //                 }
        //             }
        //         }
        //     }
        //     return conflictRoomArr;
        // },

        // 与当前教室时间不冲突的所有教室
        // getNoConflictRoom(item) {
        //     let roomArr = [];
        //     if (item && item.examDate) {
        //         let startTime = item.startTime;
        //         let endTime = item.endTime;
        //         let subdataNumber = this.ruleForm.subdataNumber;
        //         // 冲突的room
        //         for (let index = 0; index < subdataNumber.length; index++) {
        //             if (item.pId != subdataNumber[index].pId) {
        //                 let one =
        //       subdataNumber[index].startTime <= startTime &&
        //       startTime < subdataNumber[index].endTime;
        //                 let two =
        //       endTime > subdataNumber[index].startTime &&
        //       endTime <= subdataNumber[index].endTime;
        //         // 临界值
        //                 let three =
        //       subdataNumber[index].startTime >= startTime &&
        //       endTime >= subdataNumber[index].endTime;
        //                 if (one || two || three) {
        //       //
        //                 } else {
        //                     roomArr.push(subdataNumber[index]);
        //                 }
        //             }
        //         }
        //     }
        //     return roomArr;
        // },

        // 处理考场
        // handleCheckedExamNoIds(item, index) {
        //     let allConflictRooms = this.getConflictRoom(item);
        //     for (let index = 0; index < allConflictRooms.length; index++) {
        //         let room = allConflictRooms[index];
        //         if (room.pId != item.pId) {
        //             this.getExamingRooms(room, index);
        //         }
        //     }
        //     let allNoConflictRooms = this.getNoConflictRoom(item);
        //     for (let index = 0; index < allNoConflictRooms.length; index++) {
        //         let room = allNoConflictRooms[index];
        //         if (room.pId != item.pId) {
        //             this.getExamingRooms(room, index);
        //         }
        //     }
        // },

        // 根据时间获取考场
        // getExaming(item, index) {
        //     if (item.getDate) {
        //         if (item.getTime && Date.parse(item.getTime[0])) {
        //             this.ruleForm.subdataNumber[index].examDate = [];
        //             this.ruleForm.subdataNumber[index].examDate[0] = Date.parse(
        //     item.getDate
        //   ) + ((item.getTime[0]).getHours() * 60 + (item.getTime[0]).getMinutes()) * 60 * 1000;
        //             this.ruleForm.subdataNumber[index].examDate[1] = Date.parse(
        //     item.getDate
        //   ) + ((item.getTime[1]).getHours() * 60 + (item.getTime[1]).getMinutes()) * 60 * 1000;
        //             // //console.log(((item.getTime[1]).getHours() * 60 + (item.getTime[1]).getMinutes()) * 60 * 1000);
        //             this.ruleForm.subdataNumber[
        //     index
        //   ].startTime = this.ruleForm.subdataNumber[index].examDate[0];
        //             this.ruleForm.subdataNumber[
        //     index
        //   ].endTime = this.ruleForm.subdataNumber[index].examDate[1];
        //         }
        //     } 
        //     this.getExamingRooms(item, index);
        // },

        // 可选考场
        // getCanSelectArr(item) {
        //     // 所有考场
        //     let AllRoomsInfo = this.AllRoomsInfo;
        //     // 选过考场
        //     let hasInKC = [];
        //     // 冲突房间
        //     let rooms = this.getConflictRoom(item);
        //     for (let index = 0; index < rooms.length; index++) {
        //         const room = rooms[index];
        //         if (item && room.ExamNoIds.length) {
        //             room.ExamNoIds.forEach(element => {
        //                 hasInKC.push(element);
        //             });
        //         }
        //     }
        //     let canArr = AllRoomsInfo.filter(function(item) {
        //         return hasInKC.indexOf(item) == -1;
        //     });          
        //     return canArr;
        // },

        // // 选择考场
        // getExamingRooms(item, index) {          
        //     if (item && item.examDate && item.examDate[0]) {
        //         for (
        //             let index = 0;
        //             index < this.ruleForm.subdataNumber.length;
        //             index++
        //         ) {
        //             let room = this.ruleForm.subdataNumber[index];
        //             let curCanArr = this.getCanSelectArr(room);
        //             room.examRooms = curCanArr;
        //             if (item && item.ExamNoIds.length) {
        //                 room.ExamNoIds = room.ExamNoIds.filter(function(v) {
        //                     return curCanArr.indexOf(v) > -1;
        //                 });
        //             }
        //             if (room.examRooms.length == room.ExamNoIds.length) {
        //                 room.checkAll = true;
        //             } else {
        //                 room.checkAll = false;
        //             }
        //         }
        //         this.ruleForm.subdataNumber[index].roomPanelHide = true;
        //     } else {
        //         if (item) {
        //             item.examDate = null;
        //         }
        //     }
        // },

       
    }
};
</script>

<style lang="scss" scoped>
.app-container {
  position: relative;
  padding: 20px 20px 10px;
  .app-levelbar {
    height: 35px;
  }
  .el-form {
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1);
    background: #fff;
    // padding-bottom:100px;
    .appCon {
      // margin-top:50px;
      .dataItem {
        position: relative;
        margin: 0 0 40px 0;
        padding-top: 35px;
        border: 1px solid #ccc;
        .el-dialog__headerbtn {
          position: absolute;
          top: 10px;
          right: 10px;
        }
      }
    }
    .appTop {
      position: relative;
      font-size: 14px;
      color: rgb(106, 85, 72);
      padding-left: 16px;
      margin: 30px 0;
      display: block;
      &::after {
        position: absolute;
        content: "";
        width: 4px;
        height: 14px;
        background: #ff5e2c;
        left: 0;
        top: 3px;
      }
    }
    .appTitle {
      padding-top: 8px;
      text-align: center;
      font-size: 18px;
      color: #333;
      line-height: 72px;
      font-weight: bold;
      font-family: Microsoft YaHei;
      border-bottom: 1px solid #ddd;
    }
    .box {
      padding: 0px 50px;
      background: #fff;
    }
    .footer {
      text-align: center;
    }
    .exam-tips{
        font-size: 12px;
        color: #ccc;
        padding-top:10px;
    }
    .addBtn {
      margin: 0px 0 50px 10px;
      font-size: 14px;
      color: #ff5e2c;
    }
    .delBtn {
      font-size: 20px;
      color: #999;
      margin-left: 30px;
    }
    .imageBox {
      height: 330px;
      margin-left: 30px;
    }
    .isUpdataPb {
      margin-bottom: 15px;
      .el-checkbox-group {
        // label.el-checkbox:first-child{
        //     margin-left: 0;
        // }
        margin-left: -15px;
        label:first-child {
          margin-left: 15px;
        }
      }
    }
  }
}
</style>
